home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / u_man / cat1 / ar.z / ar
Encoding:
Text File  |  2002-10-03  |  14.2 KB  |  275 lines

  1. AR(1)                                                 Last changed: 8-19-98
  2.  
  3.  
  4. NNAAMMEE
  5.      aarr - archive and library maintainer
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ar -d [-lv] archive file ...
  9.      ar -m [-lv] [-abi] [posname] archive file ...
  10.      ar -p [-ls]  archive [file ...]
  11.      ar -q [-clzf]  archive file ...
  12.      ar -r [-cuvsfl] [-abi] [posname] archive file ...
  13.      ar -t [-vs] archive [file ...]
  14.      ar -x [-vosCT] archive [file ...]
  15.  
  16. IIMMPPLLEEMMEENNTTAATTIIOONN
  17.      IRIX systems
  18.  
  19. DDEESSCCRRIIPPTTIIOONN
  20.      The archiver (aarr) maintains groups of files as a single archive file.
  21.      Generally, you use this utility to create and update library files
  22.      that the link editor uses; however, you can use the archiver for any
  23.      similar purpose.
  24.  
  25.      This version of aarr produces both 32-bit and 64-bit archives.  The 32-
  26.      bit archive format is defined in the System V Release 4 ABI.  The 64-
  27.      bit archive format is defined in the 64-bit ELF OBJECT File
  28.      Specification.  32-bit objects and 64-bit objects cannot be mixed in
  29.      an archive.  The first object determines whether the archive will be
  30.      32-bit or 64-bit, if the archive does not exist to begin with.  In
  31.      compilers of version 7.x and higher, the archiver also archives WHIRL
  32.      objects.  Mixing is allowed between 32-bit relocatable ELF objects and
  33.      32-bit WHIRL objects, and between 64-bit relocatable ELF objects and
  34.      64-bit WHIRL objects.  Different versions of WHIRL objects are NOT
  35.      mixable.
  36.  
  37.      If the environment variable _XPG is defined, _a_r operates in
  38.      conformance with the X/Open XPG4 specifications.  The format of the
  39.      output may differ in accordance to the XPG4 standards.  Changes are
  40.      either in the exit status or the format of the output.
  41.  
  42.      Any option that changes an object library causes the archive-symbol-
  43.      table to be updated.  This makes adding one file at a time to a
  44.      library very slow.
  45.  
  46.      Useless options (such as using option --uu with option --tt) are not
  47.      diagnosed.
  48.  
  49.      NNOOTTEE:: aarr uses a portable ASCII-format archive that you can use on
  50.      various machines that run UNIX.
  51.  
  52.      Options are documented here with a leading hyphen(-) form.  An older
  53.      form with all option letters together and no leading hyphen is still
  54.      supported.  The first example below shows the old form.
  55.  
  56.      Examples:
  57.  
  58.           ar cr lib.a a.o b.o
  59.           ar -c -r lib.a a.o b.o
  60.           ar -cr lib.a a.o b.o
  61.  
  62.      Options are:
  63.  
  64.      --aa   Position new files in the archive after the file named by the
  65.           _p_o_s_n_a_m_e operand.  Use this suboption with the mm or rr options.
  66.  
  67.      --bb   Position new files in the archive before the file named by the
  68.           _p_o_s_n_a_m_e operand.  Use this suboption with the mm or rr options.
  69.  
  70.      --cc   Suppress the normal message that the archiver prints when it
  71.           creates the archive file _a_r_c_h_i_v_e.  Normally, the archiver creates
  72.           the specified archiver file when it needs to.
  73.  
  74.      --CC   Prevent extracted files from replacing like-named files in the
  75.           file system.  This option is useful when --TT is also used, to
  76.           prevent truncated names from replacing files with the same
  77.           prefix.
  78.  
  79.      --dd   Delete the specified _f_i_l_es from _a_r_c_h_i_v_e.
  80.  
  81.      --ii   Position new files in the archive before the file named by the
  82.           _p_o_s_n_a_m_e operand (equivalent to --bb).  Use this suboption with the
  83.           --mm or --rr options.
  84.  
  85.      --ff   Adds padding to the end of each object file archived, using the
  86.           character '\0'.  This enables the loader (lldd) to have faster
  87.           access to members in the archive while performing static linking.
  88.           _W_a_r_n_i_n_g:  this option results in the change in size of files
  89.           permanently, normally increased by 1 to 15 bytes.  In compiler
  90.           releases 7.1 and higher, this option is the default.
  91.  
  92.      --ll   Puts temporary files in the local directory.  If option --ll is not
  93.           supplied and the environment variable TTMMPPDDIIRR is defined then
  94.           TTMMPPDDIIRR's value is used as the name of the directory for temporary
  95.           files.  If neither option --ll nor TTMMPPDDIIRR is supplied, the archiver
  96.           puts its temporary files in the directory /_t_m_p.
  97.  
  98.      --mm   Moves the specified files to the end of the archive.  If you
  99.           specify a positioning character, you must also specify the
  100.           _p_o_s_n_a_m_e (as in option --rr)) to tell the archiver where to move the
  101.           files.
  102.  
  103.      --oo   Force each newly created file to have the `last modified' date
  104.           that it had before it was extracted from the archive.
  105.  
  106.      --pp   Prints the contents of the _f_i_l_es from _a_r_c_h_i_v_e to the standard
  107.           output.  If no _f_i_l_e_s are specified, the contents of all files in
  108.           the archive will be written in the order of the archive.
  109.  
  110.      --qq   Append the specified files to the end of the archive file.  The
  111.           archiver does not accept suboption positioning characters with
  112.           the --qq option.  It also does not check whether the files you want
  113.           to add already exist in the archive.  This is useful to bypass
  114.           the searching otherwise done when creating a large archive piece
  115.           by piece.  Since the archive-symbol-table of an object library is
  116.           updated with --qq it is advisable to add as many files as possible
  117.           in one execution of _a_r.  Only --qqzz (see --zz below) avoids quadratic
  118.           behavior when creating a large object archive piece by piece.
  119.  
  120.      --rr   Replace or add _f_i_l_es to _a_r_c_h_i_v_e.  If the archive named by _a_r_c_h_i_v_e
  121.           does not exist, a new archive file will be created and a
  122.           diagnostic message will be written to standard error (unless the
  123.           --cc option is specified).  If no _f_i_l_es are specified and the
  124.           _a_r_c_h_i_v_e exists, nothing is done.  Files that replace existing
  125.           files will not change the order of the archive.  If you use the
  126.           suboption --uu with --rr,, the archiver only replaces those files that
  127.           have `last-modified' dates later than the archive files.  If you
  128.           use a positioning character (from the set aabbii)) you must specify
  129.           the _p_o_s_n_a_m_e argument to tell the archiver to put the new files
  130.           after (aa) or before (bb or ii).  Otherwise, the archiver puts new
  131.           files at the end of the archive.
  132.  
  133.      --ss   Makes an archive-symbol-table file in the archive.  The --ss option
  134.           is automatically added when any of the options --dd, --mm, or --rr is
  135.           requested.
  136.  
  137.           If you specify --ss, the archiver creates the archive-symbol-table
  138.           file as its last action before finishing execution.  You must
  139.           specify at least one other archive option (mm, pp, dd, rr, or tt) when
  140.           you use the --ss option.
  141.  
  142.      --tt   Write a table of contents for the files in _a_r_c_h_i_v_e to the
  143.           standard output.  If you don't specify any file names, write a
  144.           table of contents for all files in the order of the archave.  If
  145.           you specify file names, the archiver writes a table of contents
  146.           only for those files.
  147.  
  148.      --TT   Allow filename truncation of extracted files whose archive names
  149.           are longer than the file system can support.  By default,
  150.           extracting a file with a name that is too long is an error; a
  151.           diagnostic message will be written and the file will not be
  152.           extracted.
  153.  
  154.      --uu   Update older files.  When used with the --rr option, files within
  155.           the archive will be replaced only if the corresponding _f_i_l_e is
  156.           newer than the existing _a_r_c_h_i_v_e file.  This option uses the UNIX
  157.           system `last-modified' date for this comparison.  --uu gives no
  158.           warning when replacement is refused.
  159.  
  160.      --vv   Gives a verbose file-by-file description as the archiver makes a
  161.           new archive file from an old archive and its constituent files.
  162.           When you use this option with --tt,, the archiver lists, on standard
  163.           output, all information about the files in the archive.  When you
  164.           use this option with --pp, the archiver writes the name of the file
  165.           to standard output before writing the file itself to standard
  166.           output.  If you add a second --vv additional informational messages
  167.           can appear.
  168.  
  169.      --xx   Extract the files named by the _f_i_l_e operands from the _a_r_c_h_i_v_e.
  170.           The contents of the archive file will not be changed.  If you
  171.           don't specify any file names, the archiver extracts all files.
  172.           Normally, the `last-modified' date for each extracted file shows
  173.           the date when someone extracted it; however, when you use --oo,, the
  174.           archiver resets the `last-modified' date to the date recorded in
  175.           the archive.
  176.  
  177.      --zz   Only be useful with --qq.  --qqzz supresses updating of the archive-
  178.           symbol-table and updates the archive in-place.  The resulting
  179.           archive cannot be used with _l_d (and is not a System V Release 4
  180.           ABI compliant archive) until an archive-symbol-table update is
  181.           done.  lldd(1) will fail with a message suggesting use of aarr --ttss if
  182.           the last change to the archive uses --qqzz:  Use of --qqzz is
  183.           discouraged: the updates are not checked for duplications and in
  184.           case of a file or other error the archive may be destroyed.  If
  185.           any file name added is longer than 15 characters, line _q_z updates
  186.           the archive-symbol-table even with --qqzz.  If all file names added
  187.           with qqzz on a particular execution are 15 characters or less the
  188.           archive-symbol-table update is suppressed (even if some file
  189.           names already in the archive are longer than 15 characters).  xx
  190.           option.
  191.  
  192. NNOOTTEESS
  193.      There is no _r_a_n_l_i_b program in IRIX.  Option --ss creates the archive-
  194.      symbol-table _l_d uses.
  195.  
  196.      Options --rr, --dd, --mm, and --qq imply option --ss.  Since option --ss creates
  197.      an archive-symbol-table, creating an object library by executing _a_r
  198.      once per object file will be very slow.  Creating an object library
  199.      with a single execution of _a_r is much faster.
  200.  
  201. DDIIAAGGNNOOSSTTIICCSS
  202.      xxxxxxxxxx nnoott ffoouunndd
  203.           The file xxxxxxxxxx was not found in the archive.  It could mean a
  204.           simple misspelling, but it could also mean that you supplied
  205.           xxxxxxxxxx more than the number of times xxxxxxxxxx appears in the archive!
  206.           Files not found change the exit code from _a_r but any attempted
  207.           update of the archive (by option rr for example) is not
  208.           suppressed.
  209.  
  210.      ""nnoott iinn aarrcchhiivvee ffoorrmmaatt""
  211.              You probably forgot to specify the archive name in the
  212.              command.  The _a_r_c_h_i_v_e mentioned in the synopsis should be the
  213.              archive name.
  214.  
  215.      The diagnostics "s - creating Symbol hash table" and "s - done" are no
  216.      longer emitted when --vv is used (to make the -v output standard-
  217.      conforming).  If you really want to see those messages, add a second
  218.      v, as in --vvvv.
  219.  
  220. MMOORREE NNOOTTEESS
  221.      The behavior documented in this section is not guaranteed to remain
  222.      the same across releases.  This section is provided as help in case _a_r
  223.      does something surprising.
  224.  
  225.      If there is only one hard link (ie, at most one non-symbolic link) to
  226.      an archive which is being updated then an old archive contents are
  227.      replaced by the new contents by rreennaammee(2).  (For more information on
  228.      symbolic and hard links, see llnn(2).)  Otherwise, when updating,
  229.      replacement is by copying the new data onto the old file.  If the
  230.      archive is updated, the replacement archive is built in the same
  231.      directory as the named archive (after following symbolic links to the
  232.      location of the named archive).
  233.  
  234.      In case the copy operation mentioned above is interrupted in mid-copy
  235.      (which is normally not possible) _a_r will attempt to set the archive
  236.      length to 0 and the modification-date to January 1, 1970 as a hint
  237.      that the archive is not usable.
  238.  
  239.      If the _a_r command results in an unchanged archive, the old archive
  240.      will not be replaced.  This is best achieved with, for example, _a_r _r_u
  241.      _l_i_b._a _x._o; if the named object file is not put into the archive, the
  242.      archive is not modified.  The definition of unchanged is very
  243.      conservative:  _a_r _r _l_i_b._a _x._o, for example,  always changes the
  244.      archive since x.o is added or replaced (even though x.o itself may be
  245.      unchanged).
  246.  
  247.      The following is a sampling of traditional _a_r behaviors that you may
  248.      find surprising.
  249.  
  250.      If you specify the same file twice in an argument list, it can appear
  251.      twice in the archive file.
  252.  
  253.      The oo option does not change the `last-modified' date of a file unless
  254.      you own the extracted file or you are the super-user.
  255.  
  256.      Trailing slashes are removed from file-path-names.  Only the final
  257.      component of a file-path-name is recorded in an archive.  For example,
  258.      in //aa//bb//cc//ddffiillee////////, the file searched for is //aa//bb//cc//ddffiillee, and the
  259.      name recorded in the archive is ddffiillee.
  260.  
  261.      If you give _a_r the same name twice in an aarr xx command the second
  262.      instance of the name will provoke a ``not found'' message.
  263.  
  264. FFIILLEESS
  265.      /tmp/ar.tmp.v* or TMPDIR/ar.tmp.v*      temporaries
  266.  
  267. SSEEEE AALLSSOO
  268.      lloorrddeerr((11)),, lldd((11)),, aarr(4)
  269.  
  270.      _S_y_s_t_e_m _V _A_p_p_l_i_c_a_t_i_o_n _B_i_n_a_r_y _I_n_t_e_r_f_a_c_e, ISBN 0-13-877598-2, Prentice
  271.      Hall
  272.  
  273.      This man page is available only online.
  274.  
  275.